<center>Hello User:  <t><?php echo $nameUser?></t> 
    <!--You are in the <?php echo $step;?></t> step --> </center> <br><br>

    
    <?php 
          
    $con = mysqli_connect("localhost", "root", "root");
    if (!$con) {
       die('Could not connect: '.mysqli_error());
    }
    mysqli_select_db($con,"alignedvisions");
    
     if (isset($_POST['submit'])) {
    $email = $_POST["email"];
    $nameUser = $_POST["nameUser"];
    $updatePaypal= "UPDATE entrepreneurForm SET paypal='$email' WHERE login='$nameUser'";
    
    $result = mysqli_query($con, $updatePaypal);
  
    if (!$result){
       die ('ERROR: '. mysqli_error($con));
    }
    
    echo "<script> alert('Your registration was submited successfully!'); location.href = 'index.php'; </script>";
 
     }
    
    
    ?>
    
<div id='reload'>
    In this step you should have one Paypal account, if you do not have one, it is time to create.
    <p>
    <button type='button' onclick='iHave();'>I have a Paypal Account</button>
    <button type='button' onclick='createNew();'>Create a new Paypal Account </button>            
</div>
   
<script>
    
    function iHave()
    {
        var div = document.getElementById("reload");
        
        var temp= "<form action='PayPalStep.php' method='post'> Information about your Paypal Account: <p> E-mail registered in Paypal:<input type='text' name='email'>";
        temp += "<button type='button' onclick='goBack();'>Go back</button>";
        temp += "<input type='hidden' name='nameUser' value='<?php echo $nameUser;?>'/>";
        temp += "<input class='button' name='submit' type='submit' value='Submit'/> </form>";
        
        div.innerHTML = temp;
    }
    
    function goBack()
    {
        var div = document.getElementById("reload");
        
        var temp= "In this step you should have one Paypal account, if you do not have one, it is time to create. <p>";
        temp += "<button type='button' onclick='iHave();'>I have a Paypal Account</button>";
        temp += "<button type='button' onclick='createNew();'>Create a new Paypal Account </button>";
        
        div.innerHTML = temp;
    }
    
    function createNew()
    {
        var div = document.getElementById("reload");
        var url = 'https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&ved=0CEoQ0gIoATAC&url=https%3A%2F%2Fwww.paypal.com%2Fcgi-bin%2Fwebscr%3Fcmd%3D_registration-run&ei=iMv8UZqYO4WXiALc14GQBw&usg=AFQjCNFnsVlOpnPpxnIqsleuiUAT2Eyv9Q&bvm=bv.50165853,d.cGE';
        var win=window.open(url, '_blank');
        win.focus()
        var temp= "<b>Sign Up as a Personal Use(click in the button <i>Get Started</i>) , complete the form, then Go Back</b><p>";
        temp += "<button type='button' onclick='goBack();'>Go back</button>";
        div.innerHTML = temp;
        
    }
    
</script>